﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T.FAS.Runtime.Metadata.Entity.DataModel
{
    /// <summary>
    /// 数据库表
    /// </summary>
    [Serializable]
    public class DatabaseConfig : ICloneable
    {
        /// <summary>
        /// 数据库主键id
        /// </summary>
        public string ID { get; set; }
         
        /// <summary>
        /// 数据库id
        /// </summary>
        public string DatabaseID { get; set; }

        /// <summary>
        /// 数据库配置连接串，例如：TTP.Database.TMasterMySQL.ConnectionString
        /// </summary>
        public string ConfigKey { get; set; }

        /// <summary>
        /// 配置名称
        /// </summary>
        public string ConfigName { get; set; }

        /// <summary>
        /// 配置串读写模式： 0:只读, 1:读写
        /// </summary>
        public int Mode { get; set; }

        /// <summary>
        /// 配置项排序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 是否数据库默认配置 0:否 1:是
        /// </summary>
        public bool IsDefault { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext1 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext2 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext3 { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        //[DataMember]
        [JsonIgnore]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>        
        //[DataMember]
        [JsonIgnore]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        //[DataMember]
        [JsonIgnore]
        public string LastModifier { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>        
        //[DataMember]
        [JsonIgnore]
        public DateTime LastModifyTime { get; set; }

        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}
